<template>
	<view>

		<view class="list-item" v-if="payCostList.length > 0">

			<view class="top-sec">
				<text id="money">提现金额</text>
				<text id="method">方式</text>
				<text id="time">申请时间</text>
				<text>状态</text>
				<text id="time">处理时间</text>
			</view>

			<view v-for="(item, index) in payCostList" :key="index" @click="itemClick(item)">

				<view class="income_list">

					<view class="top-sec">
						<text id="money">￥{{item.drawAmount|filterNull}}</text>
						<text id="method">{{item.drawType==0?'支付宝':item.drawType==1?'汇聚':'--'}}</text>
						<text id="time">{{item.createTime|filterNull}}</text>
						<text>{{item.drawStatus==0?'提现成功':item.drawStatus == 1?'提现失败':item.drawStatus == 2?'提现中':'--'}}</text>
						<text id="time">{{item.updateTime|filterNull}}</text>
					</view>

				</view>
			</view>
		</view>

		<u-empty v-else></u-empty>

	</view>
</template>

<script>
	import {getWithDrawInfo} from '@/api/user-api.js';

	export default {
		data() {
			return {
				payCostList: []
			}
		},

		onLoad() {
			this.getData()
		},

		methods: {

			getData() {
				getWithDrawInfo().then(res => {
					this.payCostList = res.data;
				})
			},
		},

	}
</script>

<style lang="scss" scoped>
	.top-sec {
		margin: 20upx;
		display: flex;
		justify-content: space-between;
		align-items: center;

		text {
			text-align: center;
			width: 0;
			flex-grow: 1;
			font-size: 24upx;
			color: #333;
		}
	}

	.income_list {
		display: flex;
		flex-direction: column;
		width: 100%;
		background-color: white;
	}

	#money {
		flex-grow: 0.8;
	}

	#time {
		flex-grow: 1.2;
	}

	#method {
		flex-grow: 0.7;
	}
</style>
